//
//  UILabel+Extension.swift
//  EasyDana
//
//  Created by mac on 2024/10/11.
//

import UIKit

extension UILabel {
    @IBInspectable var useRighteousFont: Bool {
        set {
            if newValue {
                self.font = UIFont(name: "Righteous-Regular", size: self.font.pointSize)
            }
        }
        get {
            return false
        }
    }
    
    static func swizzle() {
        let originalSelector = #selector(UILabel.init(coder:))
        let swizzledSelector = #selector(UILabel.my_init(coder:))
        let originalMethod = class_getInstanceMethod(UILabel.self, originalSelector)!
        let swizzledMethod = class_getInstanceMethod(UILabel.self, swizzledSelector)!
        method_exchangeImplementations(originalMethod, swizzledMethod)
    }
    
    @objc func my_init(coder: NSCoder) -> UILabel {
        let label = my_init(coder: coder)
        label.text = label.text?.locale
        return label
    }
    
    
    
}
